@extends('layouts.answer')

@section('title')
    <title>问卷调查</title>
@endsection
@section('content')
<div class="text-center"><h3>欢迎来到问卷调查</h3></div>
<div class="content">
    <div class="text-info">请选择您要回答的问卷：</div>
    <br>
    <div>
        @foreach($temps as $v)
            <div class="temps-list" data-id="{{ $v['id'] }}">
                {{ $v['name'] }}
            </div>
        @endforeach
    </div>
</div>
@endsection

@section('script')
<script>
    $(function () {
        $('.temps-list').click(function () {
            var id = $(this).attr('data-id');
            var url = '{{ url('answer/temps') }}/' + id;
            location.href = url;
        });

        $('.temps-list').bind('touchend', function () {
            $(this).trigger('click');
        });

        $('.temps-list').each(function () {
            var txt = $(this).text();
            txt = $.trim(txt);
            if(txt.length <= 6) {
                $(this).css('line-height', '3em');
            }
        });

        var msg = '{!!  session('flash_notification')  !!}';
        if(msg) {
            msg = eval('(' + msg + ')');

            layer.msg(msg[0]['message']);
        }
    });
</script>
@endsection